package UseCollection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;

public class ListQ01 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(Arrays.asList("Apple", "Banana", "Cherry"));
        list.add("你好");
        System.out.println(list);
//        ListMethod();
    }
    public static void ListMethod(){
        List<String> list = new ArrayList<>();
        list.add("ice");
        list.add("nice");
        list.add(1,"dice");
        ListIterator<String> stringListIterator = list.listIterator();
        while (stringListIterator.hasNext()){
            String next = stringListIterator.next();
            System.out.println(next);
        }
    }
    public static void ArrayListMethod(){
        ArrayList<String> str = new ArrayList<>();
        //
    }


}
